﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

namespace RecruitStudents.Client.WS.Helper
{
    public class HeaderCheck
    {
        public DataTable GetUserTable()
        {
            var obj = Hxj.Data.Cache.Default.GetCache("GetUserTable");
            if (obj == null)
            {
                DataTable dtUser = BLL.ServiceHelper.CreateBaseService().GetUserTable(string.Empty, string.Empty, string.Empty);
                Hxj.Data.Cache.Default.AddCache("GetUserTable", dtUser);
                return dtUser;
            }
            return obj as DataTable;
        }
        public DataTable GetMacTable()
        {
            var obj = Hxj.Data.Cache.Default.GetCache("GetMacTable");
            if (obj == null)
            {
                DataTable dtMac = BLL.ServiceHelper.CreateBaseService().GetExamMacTable(string.Empty, string.Empty, string.Empty, string.Empty);
                Hxj.Data.Cache.Default.AddCache("GetMacTable", dtMac);
                return dtMac;
            }
            return obj as DataTable;
        }


        public static bool _Check(BaseServiceHelper srv)
        {
            string strUserName = srv.MyHeader.Username;
            string strPassword = srv.MyHeader.Password;
            string strMacNo = srv.MyHeader.MacNo;
            if (!(srv.MyHeader.Username == "admin" && srv.MyHeader.Password == "xy"))
            {
                return false;
            }
            else
            {
                return true;
            }
        }
    }
}